/* 
 * File:   cMainStereo.cpp
 * Author: caio
 * 
 * Created on August 28, 2010, 1:15 AM
 */

#include "cMainStereo.h"

cMainStereo::cMainStereo( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );

	menuBar = new wxMenuBar( 0 );
	FileMenu = new wxMenu();
	wxMenuItem* exitMenuItem;
	exitMenuItem = new wxMenuItem( FileMenu, wxID_ANY, wxString( wxT("Exit") ) , wxEmptyString, wxITEM_NORMAL );
	FileMenu->Append( exitMenuItem );

	menuBar->Append( FileMenu, wxT("File") );

	calibrateMenu = new wxMenu();
	wxMenuItem* calibrateMenuItem;
	calibrateMenuItem = new wxMenuItem( calibrateMenu, wxID_CALIBRATEMENUITEM, wxString( wxT("Calibrate with Chessboards") ) , wxEmptyString, wxITEM_NORMAL );
	calibrateMenu->Append( calibrateMenuItem );

	menuBar->Append( calibrateMenu, wxT("Calibrate") );

	cameraMenu = new wxMenu();
	wxMenuItem* stereoMenuItem;
	stereoMenuItem = new wxMenuItem( cameraMenu, wxID_ANY, wxString( wxT("Videre Stereo Cam") ) , wxEmptyString, wxITEM_NORMAL );
	cameraMenu->Append( stereoMenuItem );

	menuBar->Append( cameraMenu, wxT("Camera") );

	this->SetMenuBar( menuBar );

	wxBoxSizer* bSizer1;
	bSizer1 = new wxBoxSizer( wxHORIZONTAL );

	videoPanel = new wxPanel( this, wxID_VIDEOPANEL, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	bSizer1->Add( videoPanel, 1, wxEXPAND | wxALL, 5 );

	this->SetSizer( bSizer1 );
	this->Layout();

	this->Centre( wxBOTH );

	// Connect Events
	this->Connect( exitMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( cMainStereo::onExit ) );
	this->Connect( calibrateMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( cMainStereo::onCalibrate ) );
	this->Connect( stereoMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( cMainStereo::onStereo ) );
}

cMainStereo::~cMainStereo()
{
	// Disconnect Events
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( cMainStereo::onExit ) );
	this->Disconnect( wxID_CALIBRATEMENUITEM, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( cMainStereo::onCalibrate ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( cMainStereo::onStereo ) );

}


